** This is the Stata do file to replicate the results in the article "Does sports success increase government support? Voter (ir)rationality in a multiparty context" by Lauri Rapeli and Peter Söderlund

/* Variables
	year = Year of poll
	month = Monh of poll
	edate = Date (in Stata format) 
	id_gov = Government ID
	id_pm = Prime minister party ID
	supp_gov = Support for the government parties (%)
	supp_pm = Support for the prime minister party (%)
	gold_all1 = Gold in any event in the current month
	gold_all2 = Gold in any event in month t–1
	gold_all3 = Gold in any event in month t–2
	gold_summer_olympics = Gold in the Summer Olympic Games 
	gold_winter_olympics = Gold in the Winter Olympic Games 
	gold_wc_athletics = Gold in the World Championships in Athletics 
	gold_wc_skiing = Gold in the FIS Nordic World Ski Championships 
	gold_icehockey = Gold in the Ice Hockey World Championships 
	gold_formula1 = Gold in Formula 1 
	gold_rally = Gold in the World Rally Championships 
	sum_summer_olympics1 = Index for Summer Olympic Games (3 points for every gold, 2 points for every silver, 1 point for every bronze) in the current month
	sum_winter_olympics1 = Index for Winter Olympic Games (3 points for every gold, 2 points for every silver, 1 point for every bronze) in the current month
	sum_wc_athletics1 = Index for World Championships in Athletics (3 points for every gold, 2 points for every silver, 1 point for every bronze) in the current month
	sum_wc_skiing1 = Index for FIS Nordic World Ski Championships (3 points for every gold, 2 points for every silver, 1 point for every bronze) in the current month
	unemp_12ave = Unemployment (12-month moving average)
	months_gov = Months in office (government coalition)
	months_pm = Months in office (prime minister party) 
	honeymoon = Honemonn effect
	pandemic = Covid-19 pandemic
	govparties_n = Number of parties in the coalition
*/	

** Open data set
use "...\Sports_success data.dta" 

* Figure 1. Combined government parties’ support over time.
tw (line supp_gov edate if id_gov == 0, lwidth(0.5) lcolor(black)) (line supp_gov edate if id_gov == 1, lwidth(0.5) lcolor(black)) (line supp_gov edate if id_gov == 2, lwidth(0.5) lcolor(black)) (line supp_gov edate if id_gov == 3, lwidth(0.5) lcolor(black)) (line supp_gov edate if id_gov == 4, lwidth(0.5) lcolor(black)) (line supp_gov edate if id_gov == 5, lwidth(0.5) lcolor(black)) (line supp_gov edate if id_gov == 6, lwidth(0.5) lcolor(black)) (line supp_gov edate if id_gov == 7, lwidth(0.5) lcolor(black)) (line supp_gov edate if id_gov == 8, lwidth(0.5) lcolor(black)) (line supp_gov edate if id_gov == 9, lwidth(0.5) lcolor(black)) (line supp_gov edate if id_gov == 10, lwidth(0.5) lcolor(black)) (line supp_gov edate if id_gov == 11, lwidth(0.5) lcolor(black)), yscale(range(0 75)) ylabel(0(10)70) xscale(range(408 743)) xlabel(408 "1994" 444 "1997" 480 "2000" 516 "2003" 552 "2006" 588 "2009" 624 "2012" 660 "2015" 696 "2018" 731 "2021", labsize(4)) xline(424 434 472 509 520 568 618 651 657 665 690 713, lpattern(dash) lwidth(0.1) lcolor(cranberry)) xtitle(Year, size(5) height(8)) ytitle(Government support, size(5) height(8)) ylabel(, labsize(4)) legend(off)

* Figure 2. Prime minister parties’ support over time.
tw (line supp_pm edate if id_pm == 0, lwidth(0.5) lcolor(black)) (line supp_pm edate if id_pm == 1, lwidth(0.5) lcolor(black)) (line supp_pm edate if id_pm == 2, lwidth(0.5) lcolor(black)) (line supp_pm edate if id_pm == 3, lwidth(0.5) lcolor(black)) (line supp_pm edate if id_pm == 4, lwidth(0.5) lcolor(black)) (line supp_pm edate if id_pm == 5, lwidth(0.5) lcolor(black)) (line supp_pm edate if id_pm == 6, lwidth(0.5) lcolor(black)) (line supp_pm edate if id_pm == 7, lwidth(0.5) lcolor(black)) , xscale(range(408 743)) xlabel(408 "1994" 444 "1997" 480 "2000" 516 "2003" 552 "2006" 588 "2009" 624 "2012" 660 "2015" 696 "2018" 731 "2021", labsize(4)) xline(424 472 520 568 618 665 713, lpattern(dash) lwidth(0.1) lcolor(cranberry)) xtitle(Year, size(5) height(8)) ytitle(Prime minister party support, size(5) height(8)) yscale(range(0 75)) ylabel(0(10)70, labsize(4)) legend(off)

* Table 1, Model 1. Predicting combined government support and prime minister party support: fixed-effecs regression with cluster-robust standard errors.
xtset id_gov edate
xtreg supp_gov gold_all1 unemp_12ave months_gov honeymoon pandemic govparties_n, fe vce(cluster id_gov)

* Table 1, Model 2. Predicting combined government support and prime minister party support: fixed-effecs regression with cluster-robust standard errors.
xtreg supp_gov gold_all1 gold_all2 unemp_12ave months_gov honeymoon pandemic govparties_n, fe vce(cluster id_gov)

* Table 1, Model 3. Predicting combined government support and prime minister party support: fixed-effecs regression with cluster-robust standard errors.
xtreg supp_gov gold_all1 gold_all2 gold_all3 unemp_12ave months_gov honeymoon pandemic govparties_n, fe vce(cluster id_gov)

* Table 1, Model 4. Predicting combined government support and prime minister party support: fixed-effecs regression with cluster-robust standard errors.
xtset id_pm edate
xtreg supp_pm gold_all1 unemp_12ave months_pm honeymoon pandemic, fe vce(cluster id_pm)

* Table 1, Model 5. Predicting combined government support and prime minister party support: fixed-effecs regression with cluster-robust standard errors.
xtreg supp_pm gold_all1 gold_all2 unemp_12ave months_pm honeymoon pandemic, fe vce(cluster id_pm)

* Table 1, Model 6. Predicting combined government support and prime minister party support: fixed-effecs regression with cluster-robust standard errors.
xtreg supp_pm gold_all1 gold_all2 gold_all3 unemp_12ave months_pm honeymoon pandemic, fe vce(cluster id_pm)

* Table 2, Model 7. Estimating the effects of multiple sports success dummy variables.
xtset id_gov edate
xtreg supp_gov gold_summer_olympics gold_winter_olympics gold_wc_athletics gold_wc_skiing gold_icehockey gold_formula1 gold_rally unemp_12ave months_gov honeymoon pandemic govparties_n, fe vce(cluster id_gov)

* Table 2, Model 8. Estimating the effects of multiple sports success dummy variables.
xtset id_pm edate
xtreg supp_pm gold_summer_olympics gold_winter_olympics gold_wc_athletics gold_wc_skiing gold_icehockey gold_formula1 gold_rally unemp_12ave months_pm honeymoon pandemic, fe vce(cluster id_pm)

* Robustness tests
* Description: Indices to account for the magnitude of success in the Summer Olympic Games, Winter Olympic Games, World Championships in Athletics and FIS Nordic World Ski Championships and World Championships in Athletics. For these competitions, each gold medal was awarded three points, each silver medal two points and each bronze medal one point.
xtset id_gov edate
xtreg supp_gov sum_summer_olympics1 sum_winter_olympics1 sum_wc_athletics1 sum_wc_skiing1 gold_icehockey gold_formula1 gold_rally unemp_12ave months_gov honeymoon pandemic govparties_n, fe vce(cluster id_gov)

xtset id_pm edate
xtreg supp_pm sum_summer_olympics1 sum_winter_olympics1 sum_wc_athletics1 sum_wc_skiing1 gold_icehockey gold_formula1 gold_rally unemp_12ave months_gov honeymoon pandemic, fe vce(cluster id_pm)

